<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>管理员端|学生成绩管理系统</title>
		<link rel="stylesheet" type="text/css" href="css/identify.css" />
		<link rel="stylesheet" type="text/css" href="css/layout.css" />
		<link rel="stylesheet" type="text/css" href="css/account.css" />
		<link rel="stylesheet" type="text/css" href="css/style.css" />
		<link rel="stylesheet" type="text/css" href="css/control_index.css" />
		<link rel="stylesheet" type="text/css" href="css/easyui.css">
		<link rel="stylesheet" type="text/css" href="css/icon.css">
		<script type="text/javascript" src="js/jquery-1.7.2.min.js"></script>
		<script type="text/javascript" src="js/layer/layer.js"></script>
		<script type="text/javascript" src="js/haidao.offcial.general.js"></script>
		<script type="text/javascript" src="js/select.js"></script>
		<script type="text/javascript" src="js/haidao.validate.js"></script>

		<script type="text/javascript">
			function addElem(){
				//window.alert("hello");
				
				window.open ('form_student.html','newwindow','height=500,width=500,top=0,left=0,toolbar=no,menubar=no,scrollbars=no,resizable=no, location=no,status=no');
			};
			/**
			function promption(){
				re_fresh();
				prompt("请输入查询班级","");
				var clazz;
				
			}*/
			function re_fresh(){
				
			}
			
			function getDataRow(h){
				var row=document.createElement('div');
				col.className='td w20';
				
			}
		</script>
	</head>

	<body>
		<div class="view-topbar">
			<div class="topbar-console">
				<div class="tobar-head fl">
					<a href="#" class="topbar-logo fl">
					<span><img src="Images/logo.png" width="20" height="20"/></span>
					</a>
					<a href="index.html" class="topbar-home-link topbar-btn text-center fl"><span>管理员|成绩管理</span></a>
				</div>
			</div>
			<div class="topbar-info">
				<ul class="fr">
					<!--
					<li class="fl dropdown topbar-notice topbar-btn">
					<a href="#" class="dropdown-toggle">
					<span class="icon-notice"></span>
					<span class="topbar-num have">0</span>-->
					<!--have表示有消息，没有消息去掉have-->
					</a>
					</li>
					<!-- 					<li class="fl topbar-info-item strong">
					<div class="dropdown">
						<a href="#" class="dropdown-toggle topbar-btn">
						<span class="fl">工单服务</span>
						<span class="icon-arrow-down"></span>
						</a>
						<ul class="dropdown-menu">
							<li><a href="#">我的工单</a></li>
							<li><a href="#">提交工单</a></li>
						</ul>
					</div>
					</li>
					 -->
					<li class="fl topbar-info-item">
					<div class="dropdown">
					</div>
					</li>
					<li class="fl topbar-info-item">
					<div class="dropdown">
						<a href="#" class="topbar-btn">
						<span class="fl text-normal">管理员</span>
						<span class="icon-arrow-down"></span>
						</a>
						<ul class="dropdown-menu">
							<li><a href="login.html">退出</a></li>
						</ul>
					</div>
					</li>
				</ul>
			</div>
		</div>
		<div class="view-body">
			<div class="view-sidebar">
				<div class="sidebar-content">
					<div class="sidebar-nav">
						<div class="sidebar-title">
							<a href="#">
								<span class="icon"><b class="fl icon-arrow-down"></b></span>
								<span class="text-normal">系统管理</span>
							</a>
						</div>
						<ul class="sidebar-trans">
							<li>
								<a href="setting.html">
									<b class="sidebar-icon"></b>
									<span class="text-normal">系统设置</span>
								</a>
							</li>
							<!-- <li>
								<a href="#">
									<b class="sidebar-icon"><img src="Images/icon_market.png" width="16" height="16" /></b>
									<span class="text-normal">云市场</span>
								</a>
							</li> -->
						</ul>
					</div>
					<div class="sidebar-nav">
						<div class="sidebar-title">
							<a href="#">
								<span class="icon"><b class="fl icon-arrow-down"></b></span>
								<span class="text-normal">信息录入</span>
							</a>
						</div>
						<ul class="sidebar-trans">
							<li>
								<a href="teacherInfo.html">
									<b class="sidebar-icon"></b>
									<span class="text-normal">教师信息管理</span>
								</a>
							</li>
							<li>
								<a href="studentInfo.html">
									<b class="sidebar-icon"></b>
									<span class="text-normal">学生信息管理</span>
								</a>
							</li>
							<li>
								<a href="courseInfo.html">
									<b class="sidebar-icon"></b>
									<span class="text-normal">课程管理</span>
								</a>
							</li>
							
						</ul>
					</div>
						<div class="sidebar-nav">
						<div class="sidebar-title">
							<a href="#">
								<span class="icon"><b class="fl icon-arrow-down"></b></span>
								<span class="text-normal">成绩分析</span>
							</a>
						</div>
						<ul class="sidebar-trans">
							<li>
								<a href="courseScore.html">
									<b class="sidebar-icon"></b>
									<span class="text-normal">查看成绩</span>
								</a>
							</li>
							<!-- <li>
								<a href="#">
									<b class="sidebar-icon"><img src="Images/icon_market.png" width="16" height="16" /></b>
									<span class="text-normal">云市场</span>
								</a>
							</li> -->
						</ul>
					</div>
				</div>
			</div>
			<div class="view-product">
				<div class="message-manage">
					<div class="manage-head">
						<h6 class="padding-left manage-head-con">操作平台</h6>
					</div>
					<div class="manage-detail">
						<h6 class="h5">该操作平台用于添加与查询学生信息</h6>
						<div class="margin-tb manage-detail-con clearfix">
							<span class="h5 fl"><em class="h2"> </em></span>
							<a class="h5 recharge fl" href="javascript:void(0)" onclick="addElem()">添加</a>
							<a class="h5 margin-large-left custom fl" href="javascript:void(0)" onclick="promption()">查询</a>
						</div>
					</div>
					<div class="manage-record margin-lr">
						<h6 class="margin-big-top"><span class="fl manage-title border-bottom-main">学生列表</span>
						<span class="fr record-fond">
						<div class="select-table sel_small fr">
							<div>
								<input readonly="readonly" value="请输入学生姓名" type="text">
								<span>
								<img src="/statics/console/images/icon_lit1.png" width="10">
								</span>
							</div>
							<ul>
							</ul>
						</div>
						<span class="fr margin-small-top">按班级查找：</span>
						</span>
						<div class="clear">
						</div>
						</h6>
						<div class="offcial-table margin-top clearfix">
							<div class="offcial-table tr-border margin-big-top clearfix">
								<div class="tr-th clearfix">
									<div class="th w20">
										学号
									</div>
									<div class="th w20">
										姓名
									</div>
									<div class="th w20">
										专业
									</div>
									<div class="th w20">
										班级
									</div>
									<div class="th w20">
										操作
									</div>
								</div>
								<div id="elems" class="tr clearfix border-bottom-none">
									<div class="td w20">
										00001
									</div>
									<div class="td w20">
										郑垃圾
									</div>
									<div class="td w20">
										软件工程
									</div>
									<div class="td w20">
										14级01班
									</div>
									<div class="td w20">
										<a href="#" msg="您是否删除此站点，如果删除会影响站点通信导致部分功能无法使用？" callback="del_site(624)" data-id="" class="button-word2 btn_ajax_confirm">删除</a>
									</div>
								</div>
								
							</div>
						</div>
						<!--
						<div class="show-page padding-big-right">
							<div class="page">
								<div class="page">
									<ul class="offcial-page margin-top margin-big-right">
										<li>共<em id="amount" class="margin-small-left margin-small-right">1</em>条数据</li>
										<li>每页显示<em class="margin-small-left margin-small-right">15</em>条</li>
										<li><a class="next disable">上一页</a></li>
										<li></li>
										<li><a class="next disable">下一页</a></li>
										<li><span class="fl">共<em class="margin-small-left margin-small-right">1</em>页</span></li>
									</ul>
								</div>
							</div>
						</div>-->
					</div>
				</div>
				<div class="clear">
				</div>
				<div class="show-page padding-big-right hidden">
					<div class="page">
					</div>
				</div>
			</div>
		</div>

		<script>
			/**
			$(".sidebar-title").live('click', function() {
				if ($(this).parent(".sidebar-nav").hasClass("sidebar-nav-fold")) {
					$(this).next().slideDown(200);
					$(this).parent(".sidebar-nav").removeClass("sidebar-nav-fold");
				} else {
					$(this).next().slideUp(200);
					$(this).parent(".sidebar-nav").addClass("sidebar-nav-fold");
				}
			});**/
			
			function getXmlHttpObject(){
				var xmlHttpRequest;
				if(window.ActiveXObject){
				}else{
					xmlHttpRequest=new XMLHttpRequest();
				}
				return xmlHttpRequest;
			}
			myXmlHttpRequest=getXmlHttpObject();
			if(myXmlHttpRequest){
				
					var url;
					url=encodeURI("http://localhost:8080/StuScoreSystem/Student?method=queryByClass&stuclass=14级02班");
					myXmlHttpRequest.open("get",url,true);
					myXmlHttpRequest.onreadystatechange=progress;
					myXmlHttpRequest.send(null);
			}
			else{
				window.alert("error");
			}
			function progress(){
				if(myXmlHttpRequest.readyState==4){
					var json=myXmlHttpRequest.responseText;
					var json_obj=eval("("+json+")");
					var meta=json_obj.meta;
					if(meta.state=="success"){
						var per=json_obj.data;
						var divBody=document.getElementById("elems");
						divBody.innerHTML='';
						var amount=document.getElementById("amount");
						for(var i=0;i<per.length;i++){
							var col1=document.createElement('div');
							col1.className='td w20';
							col1.innerHTML=per[i].stunum;
							var str=per[i].stunum;
							divBody.appendChild(col1);
							var col2=document.createElement('div');
							col2.className='td w20';
							col2.innerHTML=per[i].stuname;
							divBody.appendChild(col2);
							var col3=document.createElement('div');
							col3.className='td w20';
							col3.innerHTML=per[i].major;
							divBody.appendChild(col3);
							var col4=document.createElement('div');
							col4.className='td w20';
							col4.innerHTML=per[i].stuclass;
							divBody.appendChild(col4);
							var col5=document.createElement('div');
							col5.className='td w20';
							col5.innerHTML='<a href="javascript:void(0)" onclick="deleteUser('+per[i].stunum+','+i+')" class="button-word2 btn_ajax_confirm">删除</a>';
							divBody.appendChild(col5);
							
							
						
						}
					}
					else{
						window.alert(meta.message);
					}
				}
			}
			function promption(){
				re_fresh();
				var stuclass=prompt("请输入查询班级","");
				myXmlHttpRequest=getXmlHttpObject();
				if(myXmlHttpRequest){
				
					var url="http://localhost:8080/StuScoreSystem/Student?method=queryByClass&stuclass="+stuclass+"";
					myXmlHttpRequest.open("get",url,true);
					myXmlHttpRequest.onreadystatechange=progress;
					myXmlHttpRequest.send(null);
				}
				else{
					window.alert("error");
				}
			}
			
			function deleteUser(stunum,row){
				myXmlHttpRequest=getXmlHttpObject();
				if(myXmlHttpRequest){
					var url="http://localhost:8080/StuScoreSystem/Admin?method=deleteUser&username="+stunum+"";
					myXmlHttpRequest.open("get",url,true);
					myXmlHttpRequest.onreadystatechange=progress_deleteUser;
					myXmlHttpRequest.send(null);
				}
				else{
					window.alert("error");
				}
			}
			
			function progress_deleteUser(){
				if(myXmlHttpRequest.readyState==4){
					var json=myXmlHttpRequest.responseText;
					var json_obj=eval("("+json+")");
					var meta=json_obj.meta;
					if(meta.state=="success"){
						window.alert(meta.message);
						location.reload(true); 
					}
				}
				else{
					window.alert(meta.message);
				}
			}
			
			
		</script>
	</body>

</html>